ternary operator in java script